<?php
require_once('/var/www/admin/www/101tours.ru/system/config/main_config.php'); // Подключаем основной файл конфигурации
exit();
set_time_limit(0);
$objLvlApi = new Lvl_Api();
$objDB = Service_Database::instance();
$arrCountries = $objDB->select('SELECT `iso`, `country_name_ru` FROM `lvl_country`');
$objDateTime = new DateTime();
$startDate = $objDateTime->modify('+1 week')->format('d.m.Y');

foreach ($arrCountries as $arrCountry) {
	$objDB->query("DELETE FROM `lvl_tour` WHERE `iso` = '" . $arrCountry['iso'] . "'");
	$objLvlApi->parseTours(strtoupper($arrCountry['iso']), $startDate);
}